package 线程的学习;

public class SimpleDaemonds implements Runnable{
    int i=0;
    public void run(){
        try{
            while(i<100){
                i++;
                System.out.println(Thread.currentThread().getName()+i);
            }
        }catch(Exception e){
            System.out.println("sleep interupted");
        }

    }

    public static void main(String[] args) {
        Thread daemon=new Thread(new SimpleDaemonds());
        daemon.setDaemon(true);
//        daemon.setDaemon(false);
        daemon.start();
        System.out.println("main end");
    }
}
